package com.talent.jiwen.http.common;

import com.talent.jiwen.http.api.EducationApi;
import com.talent.jiwen.http.api.TiKuApi;

/**
 * @date 创建时间：2017/8/5
 * @author cmw
 * @description 提供获取接口实例的方法
 */
public class ApiFactory {

    protected static final Object monitor = new Object();
    static TiKuApi tiKuApi = null;
    static EducationApi educationApi = null;

    //return Singleton
    public static TiKuApi getTiKuApiSingleton() {
        synchronized (monitor) {
            if (tiKuApi == null) {
                tiKuApi = new ApiRetrofit().getTikuApiService();
            }
            return tiKuApi;
        }
    }

    //return Singleton
    public static EducationApi getEducationApiSingleton() {
        synchronized (monitor) {
            if (educationApi == null) {
                educationApi = new ApiRetrofit().getEducationApiService();
            }
            return educationApi;

        }
    }


}
